Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add augur api start and augur collection start commands #2681

Merged
merged 6 commits into from
Feb 27, 2024

Conversation

ABrain7710
Copy link
Contributor

Description

  • Add commands to start, stop and kill the api and collection individually

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Andrew Brain <[email protected]>
@ABrain7710 ABrain7710 requested a review from sgoggins February 13, 2024 00:58
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

pylint

augur/application/cli/collection.py|235 col 23| W0621: Redefining name 'logger' from outer scope (line 28) (redefined-outer-name)
augur/application/cli/collection.py|247| C0116: Missing function or method docstring (missing-function-docstring)
augur/application/cli/collection.py|247 col 34| W0621: Redefining name 'logger' from outer scope (line 28) (redefined-outer-name)
augur/application/cli/collection.py|261| C0116: Missing function or method docstring (missing-function-docstring)
augur/application/cli/collection.py|293| C0116: Missing function or method docstring (missing-function-docstring)

@@ -0,0 +1,69 @@
import resource

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0114: Missing module docstring (missing-module-docstring)

redis_connection.flushdb()


def clear_rabbitmq_messages(connection_string, queues, logger):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

#virtual_host_string = connection_string.split("/")[-1]

logger.info("Clearing all messages from celery queue in rabbitmq")
from augur.tasks.init.celery_app import celery_app

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0415: Import outside toplevel (augur.tasks.init.celery_app.celery_app) (import-outside-toplevel)

clear_message_queues(connection_string, queues)


def clear_message_queues(connection_string, queues):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

return

# if the requested amount is greater than the hard limit then set the hard limit to the num_files value
if current_hard <= num_files:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
R1731: Consider using 'current_hard = max(current_hard, num_files)' instead of unnecessary if block (consider-using-max-builtin)

"""
Sends SIGTERM to all Augur server & worker processes
"""
logger = logging.getLogger("augur.cli")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'logger' from outer scope (line 28) (redefined-outer-name)

"""
Sends SIGKILL to all Augur server & worker processes
"""
logger = logging.getLogger("augur.cli")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'logger' from outer scope (line 28) (redefined-outer-name)

for process in augur_processes:
logger.info(f"Found process {process.pid}")

def get_augur_collection_processes():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

pass
return augur_processes

def is_collection_process(process):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

return False


def augur_stop(signal, logger):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'signal' from outer scope (line 12) (redefined-outer-name)

@ABrain7710 ABrain7710 marked this pull request as draft February 13, 2024 00:59
@ABrain7710 ABrain7710 requested a review from Ulincsys February 13, 2024 00:59
Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of change will require some pretty extensive devops testing before release.

@ABrain7710 ABrain7710 marked this pull request as ready for review February 18, 2024 00:31
@sgoggins sgoggins deleted the branch dev February 20, 2024 01:16
@sgoggins sgoggins closed this Feb 20, 2024
@sgoggins sgoggins reopened this Feb 20, 2024
return False


def augur_stop(signal, logger):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'logger' from outer scope (line 28) (redefined-outer-name)


cleanup_after_collection_halt(logger)

def cleanup_after_collection_halt(logger):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)


cleanup_after_collection_halt(logger)

def cleanup_after_collection_halt(logger):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'logger' from outer scope (line 28) (redefined-outer-name)

clear_redis_caches(logger)

#Make sure that database reflects collection status when processes are killed/stopped.
def clean_collection_status(session):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

"""))
#TODO: write timestamp for currently running repos.

def assign_orphan_repos_to_default_user(session):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

@ABrain7710 ABrain7710 merged commit 7fc61c5 into dev Feb 27, 2024
3 of 4 checks passed
@ABrain7710 ABrain7710 deleted the add-api-start-command branch February 27, 2024 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants